/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package times.persistence.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrator
 */
@Entity
@Table(name = "slaughter_property")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "SlaughterProperty.findAll", query = "SELECT s FROM SlaughterProperty s"),
    @NamedQuery(name = "SlaughterProperty.findById", query = "SELECT s FROM SlaughterProperty s WHERE s.id = :id"),
    @NamedQuery(name = "SlaughterProperty.findByPosostoSymetoxis", query = "SELECT s FROM SlaughterProperty s WHERE s.posostoSymetoxis = :posostoSymetoxis")})
public class SlaughterProperty implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "pososto_symetoxis")
    private double posostoSymetoxis;
    @JoinColumn(name = "property_price_source_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private PropertyPriceSource propertyPriceSourceId;
    @JoinColumn(name = "price_source_slaughter_header_id", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private PriceSourceSlaughterHeader priceSourceSlaughterHeaderId;

    public SlaughterProperty() {
    }

    public SlaughterProperty(Integer id) {
        this.id = id;
    }

    public SlaughterProperty(Integer id, double posostoSymetoxis) {
        this.id = id;
        this.posostoSymetoxis = posostoSymetoxis;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public double getPosostoSymetoxis() {
        return posostoSymetoxis;
    }

    public void setPosostoSymetoxis(double posostoSymetoxis) {
        this.posostoSymetoxis = posostoSymetoxis;
    }

    public PropertyPriceSource getPropertyPriceSourceId() {
        return propertyPriceSourceId;
    }

    public void setPropertyPriceSourceId(PropertyPriceSource propertyPriceSourceId) {
        this.propertyPriceSourceId = propertyPriceSourceId;
    }

    public PriceSourceSlaughterHeader getPriceSourceSlaughterHeaderId() {
        return priceSourceSlaughterHeaderId;
    }

    public void setPriceSourceSlaughterHeaderId(PriceSourceSlaughterHeader priceSourceSlaughterHeaderId) {
        this.priceSourceSlaughterHeaderId = priceSourceSlaughterHeaderId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof SlaughterProperty)) {
            return false;
        }
        SlaughterProperty other = (SlaughterProperty) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "times.persistence.entities.SlaughterProperty[ id=" + id + " ]";
    }
    
}
